/*     */ package com.iris.egrant.web.struts2.tags;
/*     */ 
/*     */ import com.iris.egrant.app.utils.IrisStringUtils;
/*     */ import freemarker.template.Configuration;
/*     */ import freemarker.template.Template;
/*     */ import java.io.Writer;
/*     */ import java.util.ArrayList;
/*     */ import java.util.HashMap;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import javax.servlet.jsp.JspException;
/*     */ import javax.servlet.jsp.tagext.BodyTagSupport;
/*     */ import net.sf.json.JSONSerializer;
/*     */ import org.springframework.context.i18n.LocaleContextHolder;
/*     */ import org.springframework.web.context.WebApplicationContext;
/*     */ import org.springframework.web.context.support.WebApplicationContextUtils;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class TreeAndCompleteTag
/*     */   extends BodyTagSupport
/*     */ {
/*     */   private static final long serialVersionUID = 1077194066541229822L;
/*  32 */   private String key = "";
/*     */   
/*  34 */   private String locale = "";
/*     */ 
/*     */   
/*  37 */   private String id = "";
/*     */ 
/*     */   
/*  40 */   private String checkable = "false";
/*     */ 
/*     */   
/*  43 */   private String onlyChooseLeaf = "false";
/*     */ 
/*     */   
/*  46 */   private String cacheable = "true";
/*     */ 
/*     */   
/*  49 */   private String topCheckbox = "true";
/*     */   
/*  51 */   private String sqlParamVal = "";
/*     */   
/*  53 */   private String onClick = "";
/*     */ 
/*     */   
/*  56 */   private String value = "";
/*     */ 
/*     */   
/*  59 */   private List data = new ArrayList();
/*     */ 
/*     */ 
/*     */   
/*  63 */   private String width = "20px;";
/*     */ 
/*     */   
/*  66 */   private String className = "";
/*     */ 
/*     */   
/*  69 */   private String cleanIcon = "true";
/*     */ 
/*     */   
/*  72 */   private String name = "";
/*     */   
/*  74 */   private String label = "";
/*     */ 
/*     */   
/*  77 */   private String maxLength = "";
/*     */ 
/*     */   
/*  80 */   private String title = "";
/*     */   
/*     */   public String getOnClick() {
/*  83 */     return this.onClick;
/*     */   }
/*     */   
/*     */   public void setOnClick(String onClick) {
/*  87 */     this.onClick = onClick;
/*     */   }
/*     */ 
/*     */   
/*     */   public List getData() {
/*  92 */     return this.data;
/*     */   }
/*     */ 
/*     */   
/*     */   public void setData(List data) {
/*  97 */     this.data = data;
/*     */   }
/*     */   
/*     */   public String getCacheable() {
/* 101 */     return this.cacheable;
/*     */   }
/*     */   
/*     */   public void setCacheable(String cacheable) {
/* 105 */     this.cacheable = cacheable;
/*     */   }
/*     */   
/*     */   public String getSqlParamVal() {
/* 109 */     return this.sqlParamVal;
/*     */   }
/*     */   
/*     */   public void setSqlParamVal(String sqlParamVal) {
/* 113 */     this.sqlParamVal = sqlParamVal;
/*     */   }
/*     */   
/*     */   public String getCheckable() {
/* 117 */     return this.checkable;
/*     */   }
/*     */   
/*     */   public void setCheckable(String checkable) {
/* 121 */     this.checkable = checkable;
/*     */   }
/*     */   
/*     */   public String getLocale() {
/* 125 */     if (IrisStringUtils.isNullOrBlank(this.locale)) {
/* 126 */       return LocaleContextHolder.getLocale().toString();
/*     */     }
/* 128 */     return this.locale;
/*     */   }
/*     */   
/*     */   public void setLocale(String locale) {
/* 132 */     this.locale = locale;
/*     */   }
/*     */ 
/*     */   
/*     */   public int doStartTag() throws JspException {
/* 137 */     WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
/*     */ 
/*     */     
/* 140 */     Configuration cptFreemarkereConfiguration = (Configuration)context.getBean("cptFreemarkereConfiguration");
/*     */     
/*     */     try {
/* 143 */       String res = (String)this.pageContext.getAttribute("res");
/* 144 */       String ctx = (String)this.pageContext.getAttribute("ctx");
/*     */ 
/*     */       
/* 147 */       Map<String, Object> params = new HashMap<String, Object>();
/* 148 */       params.put("key", this.key);
/* 149 */       params.put("sqlParamVal", this.sqlParamVal);
/* 150 */       params.put("cacheable", this.cacheable);
/* 151 */       params.put("locale", getLocale());
/*     */       
/* 153 */       Map<String, Object> jsParams = new HashMap<String, Object>();
/*     */       
/* 155 */       jsParams.put("onClick", this.onClick);
/* 156 */       jsParams.put("checkable", this.checkable);
/* 157 */       jsParams.put("topCheckbox", this.topCheckbox);
/* 158 */       jsParams.put("onlyChooseLeaf", this.onlyChooseLeaf);
/*     */       
/* 160 */       Map<String, Object> rootMap = new HashMap<String, Object>();
/* 161 */       rootMap.put("res", res);
/* 162 */       rootMap.put("ctx", ctx);
/* 163 */       rootMap.put("id", this.id);
/* 164 */       rootMap.put("id2", this.id.replaceAll("\\[.*\\]", ""));
/* 165 */       rootMap.put("value", this.value);
/* 166 */       rootMap.put("data", this.data);
/* 167 */       rootMap.put("width", this.width);
/* 168 */       rootMap.put("name", (this.name.length() > 0) ? this.name : this.id);
/* 169 */       rootMap.put("label", this.label);
/* 170 */       rootMap.put("maxLength", this.maxLength);
/* 171 */       rootMap.put("title", this.title);
/*     */       
/* 173 */       rootMap.put("params", JSONSerializer.toJSON(params).toString());
/* 174 */       rootMap.put("jsParams", JSONSerializer.toJSON(jsParams).toString());
/* 175 */       rootMap.put("cleanIcon", this.cleanIcon);
/* 176 */       rootMap.put("className", this.className);
/*     */       
/* 178 */       Template template = cptFreemarkereConfiguration.getTemplate("treeAndComplete.ftl", "utf-8");
/*     */       
/* 180 */       template.process(rootMap, (Writer)this.pageContext.getOut());
/*     */     }
/* 182 */     catch (Exception e) {
/* 183 */       throw new JspException(e);
/*     */     } 
/*     */     
/* 186 */     return 0;
/*     */   }
/*     */ 
/*     */   
/*     */   public String getId() {
/* 191 */     return this.id;
/*     */   }
/*     */ 
/*     */   
/*     */   public void setId(String id) {
/* 196 */     this.id = id;
/*     */   }
/*     */   
/*     */   public String getValue() {
/* 200 */     return this.value;
/*     */   }
/*     */   
/*     */   public void setValue(String value) {
/* 204 */     this.value = value;
/*     */   }
/*     */   
/*     */   public String getKey() {
/* 208 */     return this.key;
/*     */   }
/*     */   
/*     */   public void setKey(String key) {
/* 212 */     this.key = key;
/*     */   }
/*     */   
/*     */   public String getWidth() {
/* 216 */     return this.width;
/*     */   }
/*     */   
/*     */   public void setWidth(String width) {
/* 220 */     this.width = width;
/*     */   }
/*     */   
/*     */   public String getClassName() {
/* 224 */     return this.className;
/*     */   }
/*     */   
/*     */   public void setClassName(String className) {
/* 228 */     this.className = className;
/*     */   }
/*     */   
/*     */   public String getName() {
/* 232 */     return this.name;
/*     */   }
/*     */   
/*     */   public void setName(String name) {
/* 236 */     this.name = name;
/*     */   }
/*     */   
/*     */   public String getLabel() {
/* 240 */     return this.label;
/*     */   }
/*     */   
/*     */   public void setLabel(String label) {
/* 244 */     this.label = label;
/*     */   }
/*     */   
/*     */   public String getTopCheckbox() {
/* 248 */     return this.topCheckbox;
/*     */   }
/*     */   
/*     */   public void setTopCheckbox(String topCheckbox) {
/* 252 */     this.topCheckbox = topCheckbox;
/*     */   }
/*     */   
/*     */   public String getMaxLength() {
/* 256 */     return this.maxLength;
/*     */   }
/*     */   
/*     */   public void setMaxLength(String maxLength) {
/* 260 */     this.maxLength = maxLength;
/*     */   }
/*     */   
/*     */   public String getCleanIcon() {
/* 264 */     return this.cleanIcon;
/*     */   }
/*     */   
/*     */   public void setCleanIcon(String cleanIcon) {
/* 268 */     this.cleanIcon = cleanIcon;
/*     */   }
/*     */   
/*     */   public String getOnlyChooseLeaf() {
/* 272 */     return this.onlyChooseLeaf;
/*     */   }
/*     */   
/*     */   public void setOnlyChooseLeaf(String onlyChooseLeaf) {
/* 276 */     this.onlyChooseLeaf = onlyChooseLeaf;
/*     */   }
/*     */   
/*     */   public String getTitle() {
/* 280 */     return this.title;
/*     */   }
/*     */   
/*     */   public void setTitle(String title) {
/* 284 */     this.title = title;
/*     */   }
/*     */ }


/* Location:              D:\文件kjt\WEB-INF\lib\egrant-core-2.2.20240205.1659.jar!\com\iris\egrant\web\struts2\tags\TreeAndCompleteTag.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */